libxl: Fix error path in libxl_device_events_handler
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 19 Feb 2014 14:03:29 +0000 (14:03 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 12 Mar 2014 14:11:31 +0000 (14:11 +0000)
libxl_device_events_handler would fail to call AO_ABORT if it failed;
instead it would simply return rc.  (This leaves the egc etc. from the
now-abolished stack frame potentially live, and leaves the ctx
locked.)

In xl, this is of no consequence, because xl will immediately exit in
this situation.  This is very likely to be true in any other callers
(of which we don't know of any, anyway).

Coverity-ID: 1181840
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
CC: coverity@xenproject.org
tools/libxl/libxl.c

index 730f6e13b312417b9eba8507addff331fb553e55..2d29ad2ce010a3c69c410b6148d412c59338a5aa 100644 (file)
@@ -3881,7 +3881,8 @@ int libxl_device_events_handler(libxl_ctx *ctx,
 
 out:
     GC_FREE;
-    return rc ? : AO_INPROGRESS;
+    if (rc) return AO_ABORT(rc);
+    return AO_INPROGRESS;
 }
 
 /******************************************************************************/